<template>
    <!-- <div>
        111
    </div> -->
    <el-row>
        <el-col :span="2" :offset="2">
            <el-checkbox v-model="isCheck"></el-checkbox>
        </el-col>
        <el-col :span="6" :offset="2">{{item.title }}</el-col>
        <el-col :span="3" :offset="5">
            <el-button type="danger" @click="delItem">删除</el-button>
        </el-col>
    </el-row>
</template>

<script lang="ts">
// import { computed } from '@vue/reactivity';
import { defineComponent,computed } from 'vue';

export default defineComponent({
    props:['item','del','index','changeFlag'],
    setup (props) {
        const delItem = () =>{
            props.del(props.index);
        };
        const isCheck = computed({
            get() {
                return props.item.flag;
            },
            set(value) {
                console.log(value);
                props.changeFlag(props.item,value);
                
            },
        });

        return {
            delItem,
            isCheck,
        }
    }
})
</script>

<style scoped>

</style>